#!/usr/bin/python3
# -*- coding: utf8 -*-
# Date   : 2023/04/28
# Author : Kwan
# Email  : allenxian@live.com
# Blog   : https://my.oschina.net/kwanxian

from flask import Flask, jsonify
from validator import flasky_validate

app = Flask(__name__)


@app.route("/api")
def api():
    return jsonify(**{"message": "Hello World"})


@app.route("/api/user")
@flasky_validate(sub="user", obj="/api/user", act="GET")
def get_user_role():
    return jsonify(**{"role": "user"})


if __name__ == "__main__":
    app.run(host="localhost")